<?php
require_once("taskView.php");
require_once(CORE_DIR.'taskModel.php');

class deleteimageAction extends authAction{

	function __construct(){
		$this->view = new taskView();
	}

	public function run($get, $post, $viewtype) {
		parent::run($get,$post,$viewtype);
		
		$status = 0;
		if (isset($get["tid"]) && isset($get["image"])) {
			if (unlink("images/".$get["tid"]."/".$get["image"]))
				$status = 1;
		}
		
		$this->view->setProperty("status", $status);
		$this->view->setProperty("id", $get["tid"]);
		$this->view->showDeleteTaskImage();
	}
}
?>